import math


def convert_num_to_chinese(t_price):
    dict_chinese = [u'零', u'壹', u'贰', u'叁', u'肆', u'伍', u'陆', u'柒', u'捌', u'玖']
    unit_chinese = [u'', u'拾', u'佰', u'仟', '', u'拾', u'佰', u'仟', '', u'拾', u'佰', u'仟']
    part_a = int(math.floor(t_price))
    part_b = round(t_price - part_a, 2)
    str_part_a = str(part_a)
    str_part_b = ''

    if len(str_part_a) > len(unit_chinese):
        return '数字太长，请不要难为我！'
    
    if part_b != 0:
        str_part_b = str(part_b)[2:]

    single_num = []
    if len(str_part_a) != 0:
        i = 0
        while i < len(str_part_a):
            single_num.append(str_part_a[i])
            i += 1
    t_num_chinese_part_a = []
    num_chinese_part_a = []
    j = 0
    bef = '0'
    if len(str_part_a) != 0:
        while j < len(str_part_a):
            curr = single_num.pop()
            if curr == '0' and bef != '0':
                t_num_chinese_part_a.append(dict_chinese[0])
                bef = curr
            if curr != '0':
                t_num_chinese_part_a.append(unit_chinese[j])
                t_num_chinese_part_a.append(dict_chinese[int(curr)])
                bef = curr
            if j == 3:
                if len(str_part_a) > 4:
                    t_num_chinese_part_a.append(u'万')
                    bef = '0'
            if j == 7:
                if len(str_part_a) > 4:
                    t_num_chinese_part_a.append(u'亿')
                    bef = '0'
            j += 1

        for i in range(len(t_num_chinese_part_a)):
            num_chinese_part_a.append(t_num_chinese_part_a.pop())

    a = ''      
    for i in num_chinese_part_a:
        a = a + i

    b = ''
    if len(str_part_b) == 1:
        b = dict_chinese[int(str_part_b[0])] + u'角'
    if len(str_part_b) == 2 and str_part_b[0] != '0':
        b = dict_chinese[int(str_part_b[0])] + u'角' + dict_chinese[int(str_part_b[1])] + u'分'
    if len(str_part_b) == 2 and str_part_b[0] == '0':
        b = dict_chinese[int(str_part_b[0])] + dict_chinese[int(str_part_b[1])] + u'分'

    if len(str_part_b) == 0:
        s = a + u'圆整'
    else:
        s = a + u'圆' + b
    return s


def convert_list(e_l):
    e_ln = list()
    e_lrn = list()
    if e_l:
        e_ll = len(e_l)
        for j in range(0, e_ll):
            e_ln.append(e_l[j][0])
        for j in range(0, e_ll, 3):
            e_lrn.append(e_ln[j:j+3])
    return e_lrn
